import { createRouter, createWebHistory } from 'vue-router';

import Home from "../components/Home.vue";
import Login from "../components/Login.vue";
import LeaveApplicant from "../components/LeaveApplicant.vue";
import LeaveApplicant2 from "../components/LeaveApplicant2.vue";
import Main from '../components/Main.vue'; // 管理员主界面
import Main2 from '../components/Main2.vue'; // 球员主界面
import Main3 from '../components/Main3.vue';// 教练主界面
import TrainingSchedule from "../components/TrainingSchedule.vue";
import TrainingSchedule2 from "../components/TrainingSchedule2.vue";
import TrainingSchedule3 from "../components/TrainingSchedule3.vue";
import News from "../components/News.vue";
import News2 from "../components/News2.vue";
import player from "../components/player.vue";
import admin from "../components/admin.vue";
import Home2 from "../components/Home2.vue";
import Home3 from "../components/Home3.vue";
import game from "../components/game.vue";
import game2 from "../components/game2.vue";
import announcement from "../components/announcement.vue";
import announcement2 from "../components/announcement2.vue";
import playerEcharts from "../components/playerEcharts.vue";
import admin2 from "../components/admin2.vue";
import coach from "../components/coach.vue";
import admin3 from "../components/admin3.vue";
import playerdata from "../components/playerdata.vue";
import personalinformation from "../components/personalinformation.vue";
import coachEcharts from "../components/coachEcharts.vue";
import personalinformation2 from "../components/personalinformation2.vue";
import personalinformation3 from "../components/personalinformation3.vue";

const routes = [
    { path: '/', redirect: '/login' },
    { path: '/login', name: 'Login', component: Login },
    {
        path: '/admin/Main',
        component: Main,
        redirect: '/admin/Main/adminhome',
        children: [
            { path: 'adminhome', name: 'AdminHome', component: Home },
            { path: 'admin', name: 'Admin', component: admin },
            { path: 'LeaveApplicant', name: 'AdminLeaveApplicant', component: LeaveApplicant },
            { path: 'TrainingSchedule3', name:'AdminTrainingSchedule3', component: TrainingSchedule3},
            { path: 'announcement', name:'AdminAnnouncement', component: announcement},
            { path: 'News', name:'AdminNews', component: News},
            { path: 'News', name:'AdminNews', component: News},
            { path: 'game', name:'AdminGame', component: game},
            { path: 'playerecharts', name:'AdminplayerEcharts', component: playerEcharts},
            { path: 'admin2', name:'Admin2', component: admin2},
            { path: 'admin3', name:'Admin3', component: admin3},
            { path: 'coachecharts', name:'AdmincoachEcharts', component: coachEcharts},
            { path: 'personal', name:'AdminPersonal', component: personalinformation3},
        ]
    },
    {
        path: '/player/Main2',
        component: Main2,
        redirect: '/player/Main2/playerhome',
        children: [
            { path: 'playerhome', name: 'PlayerHome', component: Home2 },
            { path: 'player', name: 'Player1', component: player },
            { path: 'LeaveApplicant2', name: 'PlayerLeaveApplicant2', component: LeaveApplicant2 },
            { path: 'TrainingSchedule', name:'PlayerTrainingSchedule', component: TrainingSchedule},
            { path: 'announcement2', name:'PlayerAnnouncement', component: announcement2},
            { path: 'News2', name:'PlayerNews2', component: News2},
            { path: 'game2', name:'PlayerGame', component: game2},
            { path: 'playerecharts', name:'PlayerplayerEcharts', component: playerEcharts},
            { path: 'coach', name:'Coach1', component: coach},
            { path: 'playerdata', name:'PlayerData1', component: playerdata},
            { path: 'personal', name:'PlayerPersonal', component: personalinformation},
            { path: 'coachecharts', name:'PlayercoachEcharts', component: coachEcharts},
        ]
    },
    {
        path: '/coach/Main3',
        component: Main3,
        redirect: '/coach/Main3/coachhome',
        children: [
            { path: 'coachhome', name: 'CoachHome', component: Home3 },
            { path: 'player', name: 'Player2', component: player },
            { path: 'LeaveApplicant2', name: 'CoachLeaveApplicant2', component: LeaveApplicant2 },
            { path: 'TrainingSchedule2', name:'CoachTrainingSchedule2', component: TrainingSchedule2},
            { path: 'announcement2', name:'CoachAnnouncement', component: announcement2},
            { path: 'News2', name:'CoachNews2', component: News2},
            { path: 'game2', name:'CoachGame', component: game2},
            { path: 'playerecharts', name:'CoachplayerEcharts', component: playerEcharts},
            { path: 'coach', name:'Coach2', component: coach},
            { path: 'playerdata', name:'PlayerData2', component: playerdata},
            { path: 'coachecharts', name:'CoachcoachEcharts', component: coachEcharts},
            { path: 'personal', name:'CoachPersonal', component: personalinformation2},
        ]
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;


